import { MockMethod } from 'vite-plugin-mock';

export default [
    // 获取所有部门列表
    {
        url: '/mock/api/depts/list',
        method: 'get',
        response() {
            return {
                code: '000000',
                data: [
                    {
                        deptId: '655dbeee11c02c8597dce111',
                        deptName: '技术中心',
                        userId: '1000002',
                        userName: 'admin',
                        parentId: '',
                        createId: '1000002',
                        updateTime: '2023-11-22T08:23:39.919Z',
                        createTime: '2023-11-22T08:23:39.919Z',
                        children: [
                            {
                                deptId: '655dbeee11c02c8597dce11a',
                                deptName: '前端部门',
                                userId: '1000002',
                                userName: 'admin',
                                parentId: '655dbeee11c02c8597dce111',
                                createId: '1000002',
                                updateTime: '2023-11-22T08:23:39.919Z',
                                createTime: '2023-11-22T08:23:39.919Z'
                            },
                            {
                                deptId: '655dbeee11c02c8597dce11b',
                                deptName: '后端部门',
                                userId: '1000002',
                                userName: 'admin',
                                parentId: '655dbeee11c02c8597dce111',
                                createId: '1000002',
                                updateTime: '2023-11-22T08:48:49.920Z',
                                createTime: '2023-11-22T08:23:39.919Z'
                            },
                            {
                                deptId: '655dbeee11c02c8597dce11c',
                                deptName: '测试部门',
                                userId: '1000002',
                                userName: 'admin',
                                parentId: '655dbeee11c02c8597dce111',
                                createId: '1000002',
                                updateTime: '2023-11-22T08:23:39.919Z',
                                createTime: '2023-11-22T08:23:39.919Z'
                            }
                        ]
                    },
                    {
                        deptId: '655dbeee11c02c8597dce222',
                        deptName: '产品部门',
                        userName: 'admin',
                        userId: '1000002',
                        parentId: '',
                        createId: '1000002',
                        updateTime: '2023-11-22T08:23:39.919Z',
                        createTime: '2023-11-22T08:23:39.919Z',
                        children: [
                            {
                                deptId: '655dbeee11c02c8597dce22a',
                                deptName: '市场部门',
                                userId: '1000002',
                                userName: 'admin',
                                parentId: '655dbeee11c02c8597dce222',
                                createId: '1000002',
                                updateTime: '2023-11-22T08:23:39.919Z',
                                createTime: '2023-11-22T08:23:39.919Z'
                            }
                        ]
                    }
                ],
                msg: 'success'
            };
        }
    },
    // 创建部门
    {
        url: '/mock/api/depts/create',
        method: 'get',
        response() {
            return {
                code: '000000',
                data: '',
                msg: 'success'
            };
        }
    },
    // 编辑部门
    {
        url: '/mock/api/depts/edit',
        method: 'post',
        response() {
            return {
                code: '000000',
                data: '',
                msg: 'success'
            };
        }
    },
    // 删除部门
    {
        url: '/mock/api/depts/delete',
        method: 'post',
        response() {
            return {
                code: '000000',
                data: '',
                msg: 'success'
            };
        }
    }
] as MockMethod[];
